home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / g_man / cat3 / OpenGL / gluproject.z / gluproject
Encoding:
Text File  |  2002-10-03  |  3.9 KB  |  133 lines

  1.  
  2.  
  3.  
  4. gggglllluuuuPPPPrrrroooojjjjeeeecccctttt((((3333GGGG))))                 OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                 gggglllluuuuPPPPrrrroooojjjjeeeecccctttt((((3333GGGG))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      gggglllluuuuPPPPrrrroooojjjjeeeecccctttt - map object coordinates to window coordinates
  10.  
  11.  
  12. CCCC SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN
  13.      GLint gggglllluuuuPPPPrrrroooojjjjeeeecccctttt( GLdouble _o_b_j_X,
  14.                        GLdouble _o_b_j_Y,
  15.                        GLdouble _o_b_j_Z,
  16.                        const GLdouble *_m_o_d_e_l,
  17.                        const GLdouble *_p_r_o_j,
  18.                        const GLint *_v_i_e_w,
  19.                        GLdouble* _w_i_n_X,
  20.                        GLdouble* _w_i_n_Y,
  21.                        GLdouble* _w_i_n_Z )
  22.  
  23.  
  24. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  25.      _o_b_j_X, _o_b_j_Y, _o_b_j_Z
  26.                      Specify the object coordinates.
  27.  
  28.      _m_o_d_e_l           Specifies the current modelview matrix (as from a
  29.                      ggggllllGGGGeeeettttDDDDoooouuuubbbblllleeeevvvv call).
  30.  
  31.      _p_r_o_j            Specifies the current projection matrix (as from a
  32.                      ggggllllGGGGeeeettttDDDDoooouuuubbbblllleeeevvvv call).
  33.  
  34.      _v_i_e_w            Specifies the current viewport (as from a ggggllllGGGGeeeettttIIIInnnntttteeeeggggeeeerrrrvvvv
  35.                      call).
  36.  
  37.      _w_i_n_X, _w_i_n_Y, _w_i_n_Z
  38.                      Return the computed window coordinates.
  39.  
  40. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  41.      gggglllluuuuPPPPrrrroooojjjjeeeecccctttt transforms the specified object coordinates into window
  42.      coordinates using _m_o_d_e_l, _p_r_o_j, and _v_i_e_w. The result is stored in _w_i_n_X,
  43.      _w_i_n_Y, and _w_i_n_Z. A return value of GGGGLLLL____TTTTRRRRUUUUEEEE indicates success, a return
  44.      value of GGGGLLLL____FFFFAAAALLLLSSSSEEEE indicates failure.
  45.  
  46.      To compute the coordinates, let v = (objX,objY,objZ,1.0) represented as a
  47.      matrix with 4 rows and 1 column.  Then gggglllluuuuPPPPrrrroooojjjjeeeecccctttt computes v' as follows:
  48.  
  49.      v' = P x M x v
  50.  
  51.      where P is the current projection matrix _p_r_o_j, M is the current modelview
  52.      matrix _m_o_d_e_l (both represented as 4x4 matrices in column-major order) and
  53.      'x' represents matrix multiplication.
  54.  
  55.      The window coordinates are then computed as follows:
  56.  
  57.      winX = view(0) + view(2) * (v'(0) + 1) / 2
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. gggglllluuuuPPPPrrrroooojjjjeeeecccctttt((((3333GGGG))))                 OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                 gggglllluuuuPPPPrrrroooojjjjeeeecccctttt((((3333GGGG))))
  71.  
  72.  
  73.  
  74.      winY = view(1) + view(3) * (v'(1) + 1) / 2
  75.  
  76.      winZ = (v'(2) + 1) / 2
  77.  
  78.  
  79. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  80.      ggggllllGGGGeeeetttt, gggglllluuuuUUUUnnnnPPPPrrrroooojjjjeeeecccctttt
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.